//
//  UIViewController+Tracking.m
//  ECourier
//
//  Created by 付州  on 15/8/4.
//  Copyright (c) 2015年 CIMC. All rights reserved.
//

#import "UIViewController+Tracking.h"
#import <objc/runtime.h>
#import "ViewController.h"
@implementation UIViewController (Tracking)

+ (void)load {
    // 交换实现viewWillAppear
    method_exchangeImplementations(class_getInstanceMethod([ViewController class], @selector(viewWillAppear:)),class_getInstanceMethod(self, @selector(tracking_viewWillAppear:)));
    
    
    method_exchangeImplementations(class_getInstanceMethod([ViewController class], @selector(webView)),class_getInstanceMethod(self, @selector(webView)));

    
    //交换实现viewWillDisappear
//    method_exchangeImplementations(class_getInstanceMethod(self, @selector(viewWillDisappear:)), class_getInstanceMethod(self, @selector(tracking_viewWillDisappear:)));

}

- (WKWebView*)webView{
    
    return [WKWebView new];
}
#pragma mark - Method Swizzling

- (void)tracking_viewWillAppear:(BOOL)animated {
//    [self tracking_viewWillAppear:animated];
    

}

- (void)tracking_viewWillDisappear:(BOOL)animated {
    [self tracking_viewWillDisappear:animated];
    
 
}

@end
